package com.chuangjiangx.member.basic.ddd.domain.model;


import com.chuangjiangx.dddbase.Entity;
import com.chuangjiangx.member.basic.ddd.domain.model.MbrUserMappingId;
import com.chuangjiangx.member.basic.ddd.domain.model.MbrUserMappingType;
import com.chuangjiangx.member.basic.ddd.domain.model.MemberId;
import com.chuangjiangx.member.basic.ddd.domain.model.MerchantId;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.Objects;

/**
 * Created by zhoufushou on 2017/12/20.
 * 支付用户
 */
@Getter
@NoArgsConstructor
public class MbrUserMapping extends Entity<MbrUserMappingId> {
    private MemberId memberId;
    private MerchantId merchantId;
    private String openId;
    private String mopenId;
    private String aopenId;
    private MbrUserMappingType type;
    private String aiFaceImg;

    public MbrUserMapping(MemberId memberId, MerchantId merchantId, String openId, String mopenId, MbrUserMappingType type, String aopenId, String aiFaceImg) {
        this.memberId = memberId;
        this.merchantId = merchantId;
        this.openId = openId;
        this.mopenId = mopenId;
        this.type = type;
        this.aopenId = aopenId;
        this.aiFaceImg = aiFaceImg;
    }

    public void modifyOpenid(String openId){
        this.openId = openId;
    }
    public void modifyMopenid(String mopenId){
        this.mopenId = mopenId;
    }
    public void modifyAopenId(String aopenId){
        this.aopenId = aopenId;
    }
    public void modifyAiFaceImg(String aiFaceImg) {
        this.aiFaceImg = aiFaceImg;
    }

    public void modifyMemberId(MemberId memberId){
        Objects.requireNonNull(memberId);
        this.memberId = memberId;
    }


}
